const CONNECTION_TEMPALTE = 'CONNECTION_TEMPALTE'
const CONNECTION_TYPE = 'CONNECTION_TYPE'
const CONNECTION_NAME = 'CONNECTION_NAME'
const CONNECTION_ITEM = 'CONNECTION_ITEM'
const CONNECTION_DATABASEINDEX = 'CONNECTION_DATABASEINDEX'
const connection = {
  state: {
    connection: {
      template: 0,
      type: "MYSQL",
      name: "MySQL",
      databaseIndex:0,
      item: null
    }
  },
  mutations: {
    [CONNECTION_TEMPALTE]: (state, template) => {
      state.connection.template = template;
    },
    [CONNECTION_TYPE]: (state, type) => {
      state.connection.type = type;
    },
    [CONNECTION_NAME]: (state, name) => {
      state.connection.name = name;
    },
    [CONNECTION_ITEM]: (state, item) => {
      state.connection.item = item;
    },
    [CONNECTION_DATABASEINDEX]: (state, databaseIndex) => {
      state.connection.databaseIndex = databaseIndex;
    }
  }
}

export default connection
